package com.dkm.orproject.dkmoa.service.serviceimpl.flow;

import com.dkm.orproject.dkmoa.dao.OaEntryEducationMapper;
import com.dkm.orproject.dkmoa.domain.OaEntryEducation;
import com.dkm.orproject.dkmoa.service.flow.OaEntryEducationService;
import com.dkm.orproject.utils.utils.IdToobtainUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


/**
 * @PROJECT_NAME: orproject
 * @DESCRIPTION:
 * @USER: 周佳佳
 * @DATE: 2020/8/10 11:42
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class OaEntryEducationServiceimpl implements OaEntryEducationService {
    @Autowired
    OaEntryEducationMapper oaEntryEducationMapper;
    @Resource
    IdToobtainUtils utils;
    /**
     * 物理删除语句，不使用
     * @param pkEducationId id
     * @return 返回行数
     */
    @Override
    public int deleteByPrimaryKey(Long pkEducationId) {
        return oaEntryEducationMapper.deleteByPrimaryKey(pkEducationId);
    }
    /**
     * 增加语句
     * @param record 对象
     * @return 返回行数
     */
    @Override
    public int insertSelective(OaEntryEducation record) {
        //新闻类型id为随机生成
        record.setPkEducationId(utils.getNumberId());
        return oaEntryEducationMapper.insertSelective(record);
    }
    /**
     * 根据主键查询
     * @param pkEducationId 主键
     * @return 返回对象
     */
    @Override
    public OaEntryEducation selectByPrimaryKey(Long pkEducationId) {
        return oaEntryEducationMapper.selectByPrimaryKey(pkEducationId);
    }
    /**
     * 修改或者逻辑删除的方法
     * @param record 对象
     * @return 返回行数
     */
    @Override
    public int updateByPrimaryKeySelective(OaEntryEducation record) {
        return oaEntryEducationMapper.updateByPrimaryKeySelective(record);
    }

    /**
     * 根据流程id查询
     * @param entryId 流程id
     * @return 返回数据
     */
    @Override
    public List<OaEntryEducation> selectAll(Long entryId) {
        return oaEntryEducationMapper.selectAll(entryId);
    }

    /**
     * 根据流程id查询(人员信息变更)
     * @param entryId 流程id
     * @return 返回数据
     */
    @Override
    public List<OaEntryEducation> selectAlls(Long entryId) {
        return oaEntryEducationMapper.selectAlls(entryId);
    }


}
